<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div id="my-tab" data='[
        {
            "tab":"选项1",
            "page":"内容1"
        },
        {
            "tab":"选项2",
            "page":"内容2"
        },
        {
            "tab":"选项3",
            "page":"内容3"
        }
    ]'>

    </div>
    <script src="tpl.js"></script>
    <script src="index.js"></script>

    <script>
        new MyTab('#my-tab')
    </script>
</body>

</html>